﻿@{
    ViewBag.Title = "Modificar";
}

<h2>Modificar</h2>
<form action="/ElSuper/Modificar" method="post">
    <input type="hidden" name="pos" value="@ViewBag.pos" />

      @{
      string[] names = Enum.GetNames(typeof(Ejemplo1Web.Controllers.RubrosEnum));    

  }
    <!--@for (int i = 0; i<names.Length; i++) 
    {
        var s = names[i];
        
<label>
<input type="radio" name="rubro" value="@i" checked >
<span>@s</span>
</label>
    }
    <br />-->


    <label>
  <span>Rubro</span>
  <select name="rubro">
    @for (int i = 0; i<names.Length; i++) 
    {
        var s = names[i];
        if (i == (int)Model.rubro)
        {
            <option value="@i" selected="selected">@s</option> 
        }
        else
        {
            <option value="@i">@s</option>          
        }
    }
    </select>
</label>
    <br />

    <label>
      <span>Nombre</span>
      <input type="text" name="nombre" value="@Model.nombre" />
    </label>
    <br />
    <label>
      <span>Cantidad</span>
      <input type="number" name="cantidad" value="@Model.cantidad" />
    </label>
    <br />
    <input type="submit" />
  </form>
  